package org.project.api.Vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.project.pojo.monthCom;
import org.project.utils.ArraysUtils;

/**
 * @Auther: hzy
 * @Date: 2022/4/13 14:41
 * @Description: 商品评论数
 */
@Data
public class monthComVo {

    @ApiModelProperty(value = "月份")
    private Integer[] month;

    @ApiModelProperty(value = "商品评论数")
    private Double[] com;

    @ApiModelProperty(value = "商品平均评论数")
    private Double[] avgCom;

    public monthComVo(monthCom monthCom) {

        this.month
                = ArraysUtils.processLineInt(monthCom.getMonth().substring(1, monthCom.getMonth().length() - 1).split(","));
        this.com
                = ArraysUtils.processLine(monthCom.getCom().substring(1, monthCom.getCom().length() - 1).split(","));
        this.avgCom
                = ArraysUtils.processLine(monthCom.getAvgCom().substring(1, monthCom.getAvgCom().length() - 1).split(","));
    }

}
